package main

/*
#include "v3.h"
extern int test_event_callback(char* s);
*/
import "C"
import (
	"fmt"
)

//export test_event_callback
func test_event_callback(s *C.char) C.int {

	gs := C.GoString(s)
	fmt.Println(gs)

	if gs == "abc" {
		return 1
	}
	return 0
}

func main1() {
	values := "abc"

	cData := C.CString(values)
	//defer C.free(unsafe.Pointer(cData))

	ret := C.do_event(cData,
		EventCallbackFunc(C.test_event_callback),
	)
	fmt.Println(values)
	fmt.Println(ret)
}
